home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / germbib / bst / gerabbrv.bst < prev    next >
Text File  |  1993-04-20  |  24KB  |  1,206 lines

  1. % BibTeX standard bibliography style `abbrv'
  2.         % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.         % Copyright (C) 1985, all rights reserved.
  4.         % Copying of this file is authorized only if either
  5.         % (1) you make absolutely no changes to your copy, including name, or
  6.         % (2) if you do make changes, you name it something other than
  7.         % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  8.         % This restriction helps ensure that all standard styles are identical.
  9.         % The file btxbst.doc has the documentation for this style.
  10. %   15-feb-92   (MW)    Updated for use with `bibgerman.sty': things like "and"
  11. %                       change with the language. Switch the language using the
  12. %                       language field: 
  13. %                          language = "german" | "USenglish" | "english"
  14. %                       Then a `\selectlanguage{...}' command will be pushed just
  15. %                       before the `\bibitem...' command for the entry in work.
  16.  
  17.  
  18. ENTRY
  19.   { address
  20.     author
  21.     booktitle
  22.     chapter
  23.     edition
  24.     editor
  25.     howpublished
  26.     institution
  27.     journal
  28.     key
  29.     language
  30.     month
  31.     note
  32.     number
  33.     organization
  34.     pages
  35.     publisher
  36.     school
  37.     series
  38.     title
  39.     type
  40.     volume
  41.     year
  42.   }
  43.   {}
  44.   { label }
  45.  
  46. INTEGERS { output.state before.all mid.sentence after.sentence after.block before.title }
  47.  
  48. STRINGS { s t language.state language.temp }
  49.  
  50. FUNCTION {init.state.consts}
  51. { #0 'before.all :=
  52.   #1 'mid.sentence :=
  53.   #2 'after.sentence :=
  54.   #3 'after.block :=
  55.   #4 'before.title :=
  56.   "nostate" 'language.state :=
  57. }
  58.  
  59. FUNCTION {language.state.test}
  60.   'language.temp :=
  61.   language.temp language.state =
  62.     { #1 }
  63.     { #0 }
  64.   if$
  65. }
  66.  
  67. FUNCTION {not}
  68. {   { #0 }
  69.     { #1 }
  70.   if$
  71. }
  72.  
  73. FUNCTION {and}
  74. {   'skip$
  75.     { pop$ #0 }
  76.   if$
  77. }
  78.  
  79. FUNCTION {or}
  80. {   { pop$ #1 }
  81.     'skip$
  82.   if$
  83. }
  84.  
  85. FUNCTION {output.nonnull}
  86. { 's :=
  87.   output.state mid.sentence =
  88.     { ", " * write$ }
  89.     { output.state after.block =
  90.         { add.period$ write$
  91.           newline$
  92.           "\newblock " write$
  93.         }
  94.         { output.state before.all =
  95.             'write$
  96.             % next if is for use with `new' FUNCTION {after.authors}
  97.             { output.state before.title =
  98.                 { ": " * write$ }
  99.                 { add.period$ " " * write$ }
  100.               if$
  101.             }
  102.           if$
  103.         }
  104.       if$
  105.       mid.sentence 'output.state :=
  106.     }
  107.   if$
  108.   s
  109. }
  110.  
  111. FUNCTION {output}
  112. { duplicate$ empty$
  113.     'pop$
  114.     'output.nonnull
  115.   if$
  116. }
  117.  
  118. FUNCTION {output.check}
  119. { 't :=
  120.   duplicate$ empty$
  121.     { pop$ "empty " t * " in " * cite$ * warning$ }
  122.     'output.nonnull
  123.   if$
  124. }
  125.  
  126. FUNCTION {output.bibitem}
  127. { newline$
  128.   language empty$
  129.     'skip$
  130.     { language.state language =
  131.         'skip$
  132.         { "\selectlanguage{\" language * "}" * write$
  133.           newline$
  134.         }
  135.       if$
  136.       language 'language.state :=
  137.     }
  138.   if$
  139.   "\bibitem{" write$
  140.   cite$ write$
  141.   "}" write$
  142.   newline$
  143.   ""
  144.   before.all 'output.state :=
  145. }
  146.  
  147. FUNCTION {fin.entry}
  148. { add.period$
  149.   write$
  150.   newline$
  151. }
  152.  
  153. FUNCTION {new.block}
  154. { output.state before.all =
  155.     'skip$
  156.     { after.block 'output.state := }
  157.   if$
  158. }
  159.  
  160. FUNCTION {new.sentence}
  161. { output.state after.block =
  162.     'skip$
  163.     { output.state before.all =
  164.         'skip$
  165.         { after.sentence 'output.state := }
  166.       if$
  167.     }
  168.   if$
  169. }
  170.  
  171. % new one -> sets what is specified in FUNCTION {output.nonnull}
  172. % if `before.title 'output.state = ... if$' is true
  173. FUNCTION {after.authors}
  174. { output.state before.all =
  175.     'skip$
  176.     { before.title 'output.state := }
  177.   if$
  178. }
  179.  
  180. FUNCTION {new.block.checka}
  181. { empty$
  182.     'skip$
  183.     'new.block
  184.   if$
  185. }
  186.  
  187. FUNCTION {new.block.checkb}
  188. { empty$
  189.   swap$ empty$
  190.   and
  191.     'skip$
  192.     'new.block
  193.   if$
  194. }
  195.  
  196. FUNCTION {new.block.checkc}
  197. { empty$
  198.   swap$ empty$
  199.   and
  200.     'skip$
  201.     'after.authors
  202.   if$
  203. }
  204.  
  205. FUNCTION {new.sentence.checka}
  206. { empty$
  207.     'skip$
  208.     'new.sentence
  209.   if$
  210. }
  211.  
  212. FUNCTION {new.sentence.checkb}
  213. { empty$
  214.   swap$ empty$
  215.   and
  216.     'skip$
  217.     'new.sentence
  218.   if$
  219. }
  220.  
  221. FUNCTION {field.or.null}
  222. { duplicate$ empty$
  223.     { pop$ "" }
  224.     'skip$
  225.   if$
  226. }
  227.  
  228. FUNCTION {emphasize}
  229. { duplicate$ empty$
  230.     { pop$ "" }
  231.     { "{\em " swap$ * "\/}" * }
  232.   if$
  233. }
  234.  
  235. FUNCTION {smallcaps}
  236. { duplicate$ empty$
  237.     { pop$ "" }
  238.     { "{\sc " swap$ * "}" * }
  239.   if$
  240. }
  241.  
  242. INTEGERS { nameptr namesleft numnames }
  243.  
  244. FUNCTION {format.names}
  245. { 's :=
  246.   #1 'nameptr :=
  247.   s num.names$ 'numnames :=
  248.   numnames 'namesleft :=
  249.     { namesleft #0 > }
  250.     { nameptr #1 >
  251.         { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ smallcaps 't :=
  252.           namesleft #1 >
  253.             { ", " * t * }
  254.             { numnames #2 >
  255.                 { "english" language.state.test
  256.                   "USenglish" language.state.test
  257.                   or
  258.                      {"," * }
  259.                      'skip$
  260.                   if$
  261.                 }
  262.                 'skip$
  263.               if$
  264.               t "others" =
  265.                 { " \btxetalshort{.}" * }
  266.                 { " \btxandshort{.}\ " * t * }
  267.               if$
  268.             }
  269.           if$
  270.         }
  271.         { s nameptr "{ll}{, jj}{, f.}{~vv}" format.name$ smallcaps }
  272.       if$
  273.       nameptr #1 + 'nameptr :=
  274.       namesleft #1 - 'namesleft :=
  275.     }
  276.   while$
  277. }
  278.  
  279. FUNCTION {format.authors}
  280. { author empty$
  281.     { "" }
  282.     { author format.names }
  283.   if$
  284. }
  285.  
  286. FUNCTION {format.editors}
  287. { editor empty$
  288.     { "" }
  289.     { editor format.names
  290.       editor num.names$ #1 >
  291.         { "\ (\btxeditorsshort{.})" * }
  292.         { "\ (\btxeditorshort{.})" * }
  293.       if$
  294.     }
  295.   if$
  296. }
  297.  
  298. FUNCTION {format.title}
  299. { title empty$
  300.     { "" }
  301.     { "english" language.state.test
  302.       "USenglish" language.state.test
  303.       or
  304.         { title "t" change.case$ emphasize }
  305.         { title emphasize }
  306.       if$
  307.     }
  308.   if$
  309. }
  310.  
  311. FUNCTION {n.dashify}
  312. { 't :=
  313.   ""
  314.     { t empty$ not }
  315.     { t #1 #1 substring$ "-" =
  316.         { t #1 #2 substring$ "--" = not
  317.             { "--" *
  318.               t #2 global.max$ substring$ 't :=
  319.             }
  320.             {   { t #1 #1 substring$ "-" = }
  321.                 { "-" *
  322.                   t #2 global.max$ substring$ 't :=
  323.                 }
  324.               while$
  325.             }
  326.           if$
  327.         }
  328.         { t #1 #1 substring$ *
  329.           t #2 global.max$ substring$ 't :=
  330.         }
  331.       if$
  332.     }
  333.   while$
  334. }
  335.  
  336. FUNCTION {format.date}
  337. { year empty$
  338.     { month empty$
  339.         { "" }
  340.         { "there's a month but no year in " cite$ * warning$
  341.           month
  342.         }
  343.       if$
  344.     }
  345.     { month empty$
  346.         'year
  347.         { month "\ " * year * }
  348.       if$
  349.     }
  350.   if$
  351. }
  352.  
  353. FUNCTION {format.btitle}
  354. { title emphasize
  355. }
  356.  
  357. FUNCTION {tie.or.space.connect}
  358. { duplicate$ text.length$ #3 <
  359.     { "~" }
  360.     { "\ " }
  361.   if$
  362.   swap$ * *
  363. }
  364.  
  365. FUNCTION {either.or.check}
  366. { empty$
  367.     'pop$
  368.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  369.   if$
  370. }
  371.  
  372. FUNCTION {format.bvolume}
  373. { volume empty$
  374.     { "" }
  375.     { output.state after.block =
  376.         { "\Btxvolumeshort{.}" }
  377.         { "\btxvolumeshort{.}" }
  378.       if$
  379.       volume tie.or.space.connect
  380.       series empty$
  381.         'skip$
  382.         { " \btxofseriesshort{.}\ " * series emphasize * }
  383.       if$
  384.       "volume and number" number either.or.check
  385.     }
  386.   if$
  387. }
  388.  
  389. FUNCTION {format.number.series}
  390. { volume empty$
  391.     { number empty$
  392.         { series field.or.null }
  393.         { output.state mid.sentence =
  394.             { "\btxnumbershort{.}" }
  395.             { "\Btxnumbershort{.}" }
  396.           if$
  397.           number tie.or.space.connect
  398.           series empty$
  399.             { "there's a number but no series in " cite$ * warning$ }
  400.             { " \btxinseriesshort{.}\ " * series emphasize * }
  401.           if$
  402.         }
  403.       if$
  404.     }
  405.     { "" }
  406.   if$
  407. }
  408.  
  409. FUNCTION {format.edition}
  410. { edition empty$
  411.     { "" }
  412.     { "english" language.state.test
  413.       "USenglish" language.state.test
  414.       or
  415.         { output.state mid.sentence =
  416.             { edition "l" change.case$ " \btxeditionshort{.}" * }
  417.             { edition "t" change.case$ " \btxeditionshort{.}" * }
  418.           if$
  419.         }
  420.         { edition " \btxeditionshort{.}" * }
  421.       if$
  422.     }
  423.   if$
  424. }
  425.  
  426. INTEGERS { multiresult }
  427.  
  428. FUNCTION {multi.page.check}
  429. { 't :=
  430.   #0 'multiresult :=
  431.     { multiresult not
  432.       t empty$ not
  433.       and
  434.     }
  435.     { t #1 #1 substring$
  436.       duplicate$ "-" =
  437.       swap$ duplicate$ "," =
  438.       swap$ "+" =
  439.       or or
  440.         { #1 'multiresult := }
  441.         { t #2 global.max$ substring$ 't := }
  442.       if$
  443.     }
  444.   while$
  445.   multiresult
  446. }
  447.  
  448. FUNCTION {format.pages}
  449. { pages empty$
  450.     { "" }
  451.     { pages multi.page.check
  452.         { "\btxpagesshort{.}" pages n.dashify tie.or.space.connect }
  453.         { "\btxpageshort{.}" pages tie.or.space.connect }
  454.       if$
  455.     }
  456.   if$
  457. }
  458.  
  459. FUNCTION {format.vol.num.pages}
  460. { volume field.or.null
  461.   number empty$
  462.     'skip$
  463.     { "(" number * ")" * *
  464.       volume empty$
  465.         { "there's a number but no volume in " cite$ * warning$ }
  466.         'skip$
  467.       if$
  468.     }
  469.   if$
  470.   pages empty$
  471.     'skip$
  472.     { duplicate$ empty$
  473.         { pop$ format.pages }
  474.         { ":" * pages n.dashify * }
  475.       if$
  476.     }
  477.   if$
  478. }
  479.  
  480. FUNCTION {format.chapter.pages}
  481. { chapter empty$
  482.     'format.pages
  483.     { type empty$
  484.         { "\btxchaptershort{.}" }
  485.         { "english" language.state.test
  486.           "USenglish" language.state.test
  487.           or
  488.              { type "l" change.case$ }
  489.              { type }
  490.          if$
  491.         }
  492.       if$
  493.       chapter tie.or.space.connect
  494.       pages empty$
  495.         'skip$
  496.         { ", " * format.pages * }
  497.       if$
  498.     }
  499.   if$
  500. }
  501.  
  502. FUNCTION {format.in.ed.booktitle}
  503. { booktitle empty$
  504.     { "" }
  505.     { editor empty$
  506.         { "\Btxinshort{.}\ " booktitle emphasize * }
  507.         { "\Btxinshort{.}\ " format.editors * ": " * booktitle emphasize * }
  508.       if$
  509.     }
  510.   if$
  511. }
  512.  
  513. FUNCTION {empty.misc.check}
  514. { author empty$ title empty$ howpublished empty$
  515.   month empty$ year empty$ note empty$
  516.   and and and and and
  517.   key empty$ not and
  518.     { "all relevant fields are empty in " cite$ * warning$ }
  519.     'skip$
  520.   if$
  521. }
  522.  
  523. FUNCTION {format.thesis.type}
  524. { type empty$
  525.     'skip$
  526.     { pop$
  527.       "english" language.state.test
  528.       "USenglish" language.state.test
  529.       or
  530.         { type "t" change.case$ }
  531.         { type }
  532.       if$
  533.     }
  534.   if$
  535. }
  536.  
  537. FUNCTION {format.tr.number}
  538. { type empty$
  539.     { "\Btxtechrepshort{.}" }
  540.     'type
  541.   if$
  542.   number empty$
  543.     { "english" language.state.test
  544.       "USenglish" language.state.test
  545.       or
  546.         { type empty$
  547.             { pop$ "\btxtechreplong{}" }
  548.             { "t" change.case$ }
  549.           if$
  550.         }
  551.         'skip$
  552.       if$
  553.     }
  554.     { number tie.or.space.connect }
  555.   if$
  556. }
  557.  
  558. FUNCTION {format.article.crossref}
  559. { key empty$
  560.     { journal empty$
  561.         { "need key or journal for " cite$ * " to crossref " * crossref *
  562.           warning$
  563.           ""
  564.         }
  565.         { "\Btxinshort{.}\ " journal emphasize * }
  566.       if$
  567.     }
  568.     { "\Btxinshort{.}\ " key emphasize * }
  569.   if$
  570.   " \cite{" * crossref * "}" *
  571. }
  572.  
  573. FUNCTION {format.crossref.editor}
  574. { editor #1 "{ll}{, jj}{, f.}{~vv}" format.name$ smallcaps
  575.   editor num.names$ duplicate$
  576.   #2 >
  577.     { pop$ " \btxetalshort{.}" * }
  578.     { #2 <
  579.         'skip$
  580.         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  581.             { " \btxetalshort{.}" * }
  582.             { " \btxandshort{.}\ " * editor #2 "{vv~}{ll}" format.name$ smallcaps * }
  583.           if$
  584.         }
  585.       if$
  586.     }
  587.   if$
  588. }
  589.  
  590. FUNCTION {format.book.crossref}
  591. { volume empty$
  592.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  593.       "\Btxinshort{.}\ "
  594.     }
  595.     { "\Btxvolumeshort{.}" volume tie.or.space.connect
  596.       " \btxofseriesshort{.}\ " *
  597.     }
  598.   if$
  599.   editor empty$
  600.   editor field.or.null author field.or.null =
  601.   or
  602.     { key empty$
  603.         { series empty$
  604.             { "need editor, key, or series for " cite$ * " to crossref " *
  605.               crossref * warning$
  606.               "" *
  607.             }
  608.             { series emphasize * }
  609.           if$
  610.         }
  611.         { key emphasize * }
  612.       if$
  613.     }
  614.     { "\Btxinshort{.}\ " format.crossref.editor * }
  615.   if$
  616.   " \cite{" * crossref * "}" *
  617. }
  618.  
  619. FUNCTION {format.incoll.inproc.crossref}
  620. { editor empty$
  621.   editor field.or.null author field.or.null =
  622.   or
  623.     { key empty$
  624.         { booktitle empty$
  625.             { "need editor, key, or booktitle for " cite$ * " to crossref " *
  626.               crossref * warning$
  627.               ""
  628.             }
  629.             { "\Btxinshort{.}\ " booktitle emphasize * }
  630.           if$
  631.         }
  632.         { "\Btxinshort{.}\ " key emphasize * }
  633.       if$
  634.     }
  635.     { "\Btxinshort{.}\ " format.crossref.editor * }
  636.   if$
  637.   " \cite{" * crossref * "}" *
  638. }
  639.  
  640. FUNCTION {article}
  641. { output.bibitem
  642.   format.authors "author" output.check
  643.   after.authors
  644.   format.title "title" output.check
  645.   new.block
  646.   crossref missing$
  647.     { journal 
  648.       title missing$
  649.         { emphasize }
  650.         'skip$
  651.       if$
  652.       "journal" output.check 
  653.       format.vol.num.pages output
  654.       format.date "year" output.check
  655.     }
  656.     { format.article.crossref output.nonnull
  657.       format.pages output
  658.     }
  659.   if$
  660.   new.block
  661.   note output
  662.   fin.entry
  663. }
  664.  
  665. FUNCTION {book}
  666. { output.bibitem
  667.   author empty$
  668.     { format.editors "author and editor" output.check }
  669.     { format.authors output.nonnull
  670.       crossref missing$
  671.         { "author and editor" editor either.or.check }
  672.         'skip$
  673.       if$
  674.     }
  675.   if$
  676.   after.authors
  677.   format.btitle "title" output.check
  678.   crossref missing$
  679.     { format.bvolume output
  680.       new.block
  681.       format.number.series output
  682.       new.sentence
  683.       publisher "publisher" output.check
  684.       address output
  685.     }
  686.     { new.block
  687.       format.book.crossref output.nonnull
  688.     }
  689.   if$
  690.   format.edition output
  691.   format.date "year" output.check
  692.   new.block
  693.   note output
  694.   fin.entry
  695. }
  696.  
  697. FUNCTION {booklet}
  698. { output.bibitem
  699.   format.authors output
  700.   after.authors
  701.   format.title "title" output.check
  702.   howpublished address new.block.checkb
  703.   howpublished output
  704.   address output
  705.   format.date output
  706.   new.block
  707.   note output
  708.   fin.entry
  709. }
  710.  
  711. FUNCTION {inbook}
  712. { output.bibitem
  713.   author empty$
  714.     { format.editors "author and editor" output.check }
  715.     { format.authors output.nonnull
  716.       crossref missing$
  717.         { "author and editor" editor either.or.check }
  718.         'skip$
  719.       if$
  720.     }
  721.   if$
  722.   after.authors
  723.   format.btitle "title" output.check
  724.   crossref missing$
  725.     { format.bvolume output
  726.       format.chapter.pages "chapter and pages" output.check
  727.       new.block
  728.       format.number.series output
  729.       new.sentence
  730.       publisher "publisher" output.check
  731.       address output
  732.     }
  733.     { format.chapter.pages "chapter and pages" output.check
  734.       new.block
  735.       format.book.crossref output.nonnull
  736.     }
  737.   if$
  738.   format.edition output
  739.   format.date "year" output.check
  740.   new.block
  741.   note output
  742.   fin.entry
  743. }
  744.  
  745. FUNCTION {incollection}
  746. { output.bibitem
  747.   format.authors "author" output.check
  748.   after.authors
  749.   format.title "title" output.check
  750.   new.block
  751.   crossref missing$
  752.     { format.in.ed.booktitle "booktitle" output.check
  753.       format.bvolume output
  754.       format.number.series output
  755.       format.chapter.pages output
  756.       new.sentence
  757.       publisher "publisher" output.check
  758.       address output
  759.       format.edition output
  760.       format.date "year" output.check
  761.     }
  762.     { format.incoll.inproc.crossref output.nonnull
  763.       format.chapter.pages output
  764.     }
  765.   if$
  766.   new.block
  767.   note output
  768.   fin.entry
  769. }
  770.  
  771. FUNCTION {inproceedings}
  772. { output.bibitem
  773.   format.authors "author" output.check
  774.   after.authors
  775.   format.title "title" output.check
  776.   new.block
  777.   crossref missing$
  778.     { format.in.ed.booktitle "booktitle" output.check
  779.       format.bvolume output
  780.       format.number.series output
  781.       format.pages output
  782.       address empty$
  783.         { organization publisher new.sentence.checkb
  784.           organization output
  785.           publisher output
  786.           format.date "year" output.check
  787.         }
  788.         { address output.nonnull
  789.           format.date "year" output.check
  790.           new.sentence
  791.           organization output
  792.           publisher output
  793.         }
  794.       if$
  795.     }
  796.     { format.incoll.inproc.crossref output.nonnull
  797.       format.pages output
  798.     }
  799.   if$
  800.   new.block
  801.   note output
  802.   fin.entry
  803. }
  804.  
  805. FUNCTION {conference} { inproceedings }
  806.  
  807. FUNCTION {manual}
  808. { output.bibitem
  809.   author empty$
  810.     { organization empty$
  811.         'skip$
  812.         { organization smallcaps output.nonnull
  813.           address output
  814.         }
  815.       if$
  816.     }
  817.     { format.authors output.nonnull }
  818.   if$
  819.   after.authors
  820.   format.btitle "title" output.check
  821.   author empty$
  822.     { organization empty$
  823.         { address new.block.checka
  824.           address output
  825.         }
  826.         'skip$
  827.       if$
  828.     }
  829.     { organization address new.block.checkb
  830.       organization output
  831.       address output
  832.     }
  833.   if$
  834.   format.edition output
  835.   format.date output
  836.   new.block
  837.   note output
  838.   fin.entry
  839. }
  840.  
  841. FUNCTION {mastersthesis}
  842. { output.bibitem
  843.   format.authors "author" output.check
  844.   after.authors
  845.   format.title "title" output.check
  846.   new.block
  847.   "\btxmastthesis{}" format.thesis.type output.nonnull
  848.   school "school" output.check
  849.   address output
  850.   format.date "year" output.check
  851.   new.block
  852.   note output
  853.   fin.entry
  854. }
  855.  
  856. FUNCTION {misc}
  857. { output.bibitem
  858.   format.authors output
  859.   title howpublished new.block.checkc
  860.   format.title output
  861.   howpublished new.block.checka
  862.   howpublished output
  863.   format.date output
  864.   new.block
  865.   note output
  866.   fin.entry
  867.   empty.misc.check
  868. }
  869.  
  870. FUNCTION {phdthesis}
  871. { output.bibitem
  872.   format.authors "author" output.check
  873.   after.authors
  874.   format.btitle "title" output.check
  875.   new.block
  876.   "\btxphdthesis{}" format.thesis.type output.nonnull
  877.   school "school" output.check
  878.   address output
  879.   format.date "year" output.check
  880.   new.block
  881.   note output
  882.   fin.entry
  883. }
  884.  
  885. FUNCTION {proceedings}
  886. { output.bibitem
  887.   editor empty$
  888.     { organization smallcaps output }
  889.     { format.editors output.nonnull }
  890.   if$
  891.   after.authors
  892.   format.btitle "title" output.check
  893.   format.bvolume output
  894.   format.number.series output
  895.   address empty$
  896.     { editor empty$
  897.         { publisher new.sentence.checka }
  898.         { organization publisher new.sentence.checkb
  899.           organization output
  900.         }
  901.       if$
  902.       publisher output
  903.       format.date "year" output.check
  904.     }
  905.     { address output.nonnull
  906.       format.date "year" output.check
  907.       new.sentence
  908.       editor empty$
  909.         'skip$
  910.         { organization output }
  911.       if$
  912.       publisher output
  913.     }
  914.   if$
  915.   new.block
  916.   note output
  917.   fin.entry
  918. }
  919.  
  920. FUNCTION {techreport}
  921. { output.bibitem
  922.   format.authors "author" output.check
  923.   after.authors
  924.   format.title "title" output.check
  925.   new.block
  926.   format.tr.number output.nonnull
  927.   institution "institution" output.check
  928.   address output
  929.   format.date "year" output.check
  930.   new.block
  931.   note output
  932.   fin.entry
  933. }
  934.  
  935. FUNCTION {unpublished}
  936. { output.bibitem
  937.   format.authors "author" output.check
  938.   after.authors
  939.   format.title "title" output.check
  940.   new.block
  941.   note "note" output.check
  942.   format.date output
  943.   fin.entry
  944. }
  945.  
  946. FUNCTION {default.type} { misc }
  947.  
  948. MACRO {jan} {"\btxmonjanshort{.}"}
  949.  
  950. MACRO {feb} {"\btxmonfebshort{.}"}
  951.  
  952. MACRO {mar} {"\btxmonmarshort{.}"}
  953.  
  954. MACRO {apr} {"\btxmonaprshort{.}"}
  955.  
  956. MACRO {may} {"\btxmonmayshort{.}"}
  957.  
  958. MACRO {jun} {"\btxmonjunshort{.}"}
  959.  
  960. MACRO {jul} {"\btxmonjulshort{.}"}
  961.  
  962. MACRO {aug} {"\btxmonaugshort{.}"}
  963.  
  964. MACRO {sep} {"\btxmonsepshort{.}"}
  965.  
  966. MACRO {oct} {"\btxmonoctshort{.}"}
  967.  
  968. MACRO {nov} {"\btxmonnovshort{.}"}
  969.  
  970. MACRO {dec} {"\btxmondecshort{.}"}
  971.  
  972. MACRO {acmcs} {"ACM Comput. Surv."}
  973.  
  974. MACRO {acta} {"Acta Inf."}
  975.  
  976. MACRO {cacm} {"Commun. ACM"}
  977.  
  978. MACRO {ibmjrd} {"IBM J. Res. Dev."}
  979.  
  980. MACRO {ibmsj} {"IBM Syst.~J."}
  981.  
  982. MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
  983.  
  984. MACRO {ieeetc} {"IEEE Trans. Comput."}
  985.  
  986. MACRO {ieeetcad}
  987.  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
  988.  
  989. MACRO {ipl} {"Inf. Process. Lett."}
  990.  
  991. MACRO {jacm} {"J.~ACM"}
  992.  
  993. MACRO {jcss} {"J.~Comput. Syst. Sci."}
  994.  
  995. MACRO {scp} {"Sci. Comput. Programming"}
  996.  
  997. MACRO {sicomp} {"SIAM J. Comput."}
  998.  
  999. MACRO {tocs} {"ACM Trans. Comput. Syst."}
  1000.  
  1001. MACRO {tods} {"ACM Trans. Database Syst."}
  1002.  
  1003. MACRO {tog} {"ACM Trans. Gr."}
  1004.  
  1005. MACRO {toms} {"ACM Trans. Math. Softw."}
  1006.  
  1007. MACRO {toois} {"ACM Trans. Office Inf. Syst."}
  1008.  
  1009. MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
  1010.  
  1011. MACRO {tcs} {"Theoretical Comput. Sci."}
  1012.  
  1013. READ
  1014.  
  1015. FUNCTION {sortify}
  1016. { purify$
  1017.   "l" change.case$
  1018. }
  1019.  
  1020. INTEGERS { len }
  1021.  
  1022. FUNCTION {chop.word}
  1023. { 's :=
  1024.   'len :=
  1025.   s #1 len substring$ =
  1026.     { s len #1 + global.max$ substring$ }
  1027.     's
  1028.   if$
  1029. }
  1030.  
  1031. FUNCTION {sort.format.names}
  1032. { 's :=
  1033.   #1 'nameptr :=
  1034.   ""
  1035.   s num.names$ 'numnames :=
  1036.   numnames 'namesleft :=
  1037.     { namesleft #0 > }
  1038.     { nameptr #1 >
  1039.         { "   " * }
  1040.         'skip$
  1041.       if$
  1042.       s nameptr "{ll{ }}{  f{ }}{vv{ } }{  jj{ }}" format.name$ 't :=
  1043.       nameptr numnames = t "others" = and
  1044.         { "et al" * }
  1045.         { t sortify * }
  1046.       if$
  1047.       nameptr #1 + 'nameptr :=
  1048.       namesleft #1 - 'namesleft :=
  1049.     }
  1050.   while$
  1051. }
  1052.  
  1053. FUNCTION {sort.format.title}
  1054. { 't :=
  1055.   "A " #2
  1056.     "An " #3
  1057.       "The " #4 t chop.word
  1058.     chop.word
  1059.   chop.word
  1060.   sortify
  1061.   #1 global.max$ substring$
  1062. }
  1063.  
  1064. FUNCTION {author.sort}
  1065. { author empty$
  1066.     { key empty$
  1067.         { "to sort, need author or key in " cite$ * warning$
  1068.           ""
  1069.         }
  1070.         { key sortify }
  1071.       if$
  1072.     }
  1073.     { author sort.format.names }
  1074.   if$
  1075. }
  1076.  
  1077. FUNCTION {author.editor.sort}
  1078. { author empty$
  1079.     { editor empty$
  1080.         { key empty$
  1081.             { "to sort, need author, editor, or key in " cite$ * warning$
  1082.               ""
  1083.             }
  1084.             { key sortify }
  1085.           if$
  1086.         }
  1087.         { editor sort.format.names }
  1088.       if$
  1089.     }
  1090.     { author sort.format.names }
  1091.   if$
  1092. }
  1093.  
  1094. FUNCTION {author.organization.sort}
  1095. { author empty$
  1096.     { organization empty$
  1097.         { key empty$
  1098.             { "to sort, need author, organization, or key in " cite$ * warning$
  1099.               ""
  1100.             }
  1101.             { key sortify }
  1102.           if$
  1103.         }
  1104.         { "The " #4 organization chop.word sortify }
  1105.       if$
  1106.     }
  1107.     { author sort.format.names }
  1108.   if$
  1109. }
  1110.  
  1111. FUNCTION {editor.organization.sort}
  1112. { editor empty$
  1113.     { organization empty$
  1114.         { key empty$
  1115.             { "to sort, need editor, organization, or key in " cite$ * warning$
  1116.               ""
  1117.             }
  1118.             { key sortify }
  1119.           if$
  1120.         }
  1121.         { "The " #4 organization chop.word sortify }
  1122.       if$
  1123.     }
  1124.     { editor sort.format.names }
  1125.   if$
  1126. }
  1127.  
  1128. FUNCTION {presort}
  1129. { type$ "book" =
  1130.   type$ "inbook" =
  1131.   or
  1132.     'author.editor.sort
  1133.     { type$ "proceedings" =
  1134.         'editor.organization.sort
  1135.         { type$ "manual" =
  1136.             'author.organization.sort
  1137.             'author.sort
  1138.           if$
  1139.         }
  1140.       if$
  1141.     }
  1142.   if$
  1143.   "    "
  1144.   *
  1145.   year field.or.null sortify
  1146.   *
  1147.   "    "
  1148.   *
  1149.   title field.or.null
  1150.   sort.format.title
  1151.   *
  1152.   #1 entry.max$ substring$
  1153.   'sort.key$ :=
  1154. }
  1155.  
  1156. ITERATE {presort}
  1157.  
  1158. SORT
  1159.  
  1160. STRINGS { longest.label }
  1161.  
  1162. INTEGERS { number.label longest.label.width }
  1163.  
  1164. FUNCTION {initialize.longest.label}
  1165. { "" 'longest.label :=
  1166.   #1 'number.label :=
  1167.   #0 'longest.label.width :=
  1168. }
  1169.  
  1170. FUNCTION {longest.label.pass}
  1171. { number.label int.to.str$ 'label :=
  1172.   number.label #1 + 'number.label :=
  1173.   label width$ longest.label.width >
  1174.     { label 'longest.label :=
  1175.       label width$ 'longest.label.width :=
  1176.     }
  1177.     'skip$
  1178.   if$
  1179. }
  1180.  
  1181. EXECUTE {initialize.longest.label}
  1182.  
  1183. ITERATE {longest.label.pass}
  1184.  
  1185. FUNCTION {begin.bib}
  1186. { preamble$ empty$
  1187.     'skip$
  1188.     { preamble$ write$ newline$ }
  1189.   if$
  1190.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1191. }
  1192.  
  1193. EXECUTE {begin.bib}
  1194.  
  1195. EXECUTE {init.state.consts}
  1196.  
  1197. ITERATE {call.type$}
  1198.  
  1199. FUNCTION {end.bib}
  1200. { newline$
  1201.   "\end{thebibliography}" write$ newline$
  1202. }
  1203.  
  1204. EXECUTE {end.bib}
  1205.